package com.glory.cqaospda.viewmodel

import com.glory.cqaospda.model.TaskRepository
import com.glory.mvvmnet.base.BaseViewModel
import com.glory.mvvmnet.entity.CallObserveBean
import com.google.gson.JsonObject

class QueryProductionInfoModel : BaseViewModel() {

    private val repository by lazy { TaskRepository() }

    fun defaultEqpInfo(eqpID: String) {
        val map = JsonObject()
        map.addProperty("EquipmentName", eqpID)
        launchWithError({
            val defaultInfo =
                repository.defaultQueryProductionInfo(map,"EMS_QueryProductionInfo")
            defUI.callObserve.value = CallObserveBean(1,defaultInfo)
        },{
            defUI.callObserve.value = CallObserveBean(2)
        })
    }
}